package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.firetraining;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.business.firetraining.FiretrainingService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 消防培训控制器
 */
@Action
@RequestMapping(value="business/firetraining")
public class FiretrainingController extends BaseController {
    @Resource
    public FiretrainingService firetrainingService;

    /**
     * 消防培训列表
     * @param
     * page	第几页
     * limit	每页多少条
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * createyear	创建年份
     * @return
     */
    @At(value = "firetrainingListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity firetrainingListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return firetrainingService.firetrainingListPage(jsonParam);
    }

    /**
     * 消防培训详情
     * @param  id	消防培训的id
     * @return
     */
    @At(value = "firetrainingDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity firetrainingDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return firetrainingService.firetrainingDetail(jsonParam);
    }

    /**
     * 消防培训新增
     * @param
     * trainingtime	培训时间
     * participant	参与人员
     * trainingcontents	培训内容
     * fileName	附件名称
     * filePath	附件路径
     * @return
     */
    @At(value = "firetrainingAdd", method = RequestMethod.POST)
    public RespEntity firetrainingAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return firetrainingService.firetrainingAdd(jsonParam);
    }

    /**
     * 消防培训修改
     * @param
     * trainingtime	培训时间
     * participant	参与人员
     * trainingcontents	培训内容
     * fileName	附件名称
     * id	消防培训id
     * filePath	附件路径
     * @return
     */
    @At(value = "firetrainingUpdate", method = RequestMethod.POST, param = { "id" })
    public RespEntity firetrainingUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return firetrainingService.firetrainingUpdate(jsonParam);
    }

    /**
     * 消防培训删除
     * @param   id	消防培训的id
     * @return
     */
    @At(value = "firetrainingDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity firetrainingDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return firetrainingService.firetrainingDelete(jsonParam);
    }






   
}